//
//  CameraPropertiesCache.h
//  YPC-Time-siso
//
//  Created by dsw on 2019/9/21.
//  Copyright © 2019 i4season. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <BaseCamera/CMResolution.h>
#import <BaseCamera/CMAdjustAngleInfo.h>
#import <BaseCamera/CMDeviceInfo.h>

@class CMAdjustAngleInfo;

@interface CameraPropertiesCache : NSObject

@property (nonatomic, strong) CMDeviceInfo *deviceInfo;
#pragma mark  属性获取与操作
/** 厂商 */
@property (nonatomic, copy) DeviceProperty manufacture;
/** 固件版本 */
@property (nonatomic, copy) DeviceProperty firmwareVersion;
/** 硬件型号 */
@property (nonatomic, copy) DeviceProperty hardwareVersion;
/** mode_name */
@property (nonatomic, copy) DeviceProperty modelName;
/// Model NUmber
@property (nonatomic, copy) DeviceProperty modelNumber;
/** sn */
@property (nonatomic, copy) DeviceProperty sn;
/** ssid */
@property (nonatomic, copy) DeviceProperty ssid;

#pragma mark - 摄像头
/// 当前分辨率列表
@property (nonatomic, strong) NSArray <CMResolution *> *resolutions;
/// 当前选择分辨率配置
@property (nonatomic, strong, readonly) CMResolution *currentResolution;

- (NSInteger)indexResolution:(CMResolution *)resolution;

- (CMResolution *)nextResolution;

// 刷新分辨率列表, 以及选中的分辨率
- (void)refreshResolutions;

#pragma mark - 黑头仪属性
/// 是否支持陀螺仪
//@property (nonatomic, assign) int hasg;
/// 电量
@property (nonatomic, assign) NSInteger battery;
/// 电量等级,  这2个值只有一个有效, 具体看型号
//@property (nonatomic, assign) NSInteger batteryLevel;
/// 充电状态
@property (nonatomic, assign) BOOL chargingStatus;
/// 低电量
@property (nonatomic, assign) BOOL powerOff;
/// 摄像头是否准备好
@property (nonatomic, assign) BOOL isSensorOk;
/// 移动提醒
@property (nonatomic, assign) BOOL needMove;
/// 冻结/暂停
@property (nonatomic, assign) BOOL pauseImage;
/// android摄像头的状态 0.没有设置。1.不显示图像，2.显示图像
@property (nonatomic, assign) CameraState cameraStatus;
/// android摄像头是否切换 1表示分辨率变了，需要重新获取分辨率列表和分辨率
//@property (nonatomic, assign) int picChangeId;
/// 黑头仪校正角度
//@property (nonatomic, assign) ImageAdjustAngleOffset imageAdjustAngleOffset;
@property (nonatomic, strong) CMAdjustAngleInfo *adjustInfo;

#pragma mark - 通用属性
/// 马达开启
@property (nonatomic, assign) BOOL motorSwitch;
/// 马达值
@property (nonatomic, assign) int motorValue;
/// 当前模式  0：正常模式（护理模式）1：厂测模式 2：黑头查看模式 3:蓝光杀菌
@property (nonatomic, assign) CameraMode cameraMode;
/// 图片亮度
@property (nonatomic, assign) NSInteger imageLight;
#pragma mark - 四季新方案 NewWifi
/// wifiFirmInfo 中的值, 支持的功能 按位与& 位移枚举的值
@property (nonatomic, assign) NSInteger capacity;
/// 多手机连接占用冲突, YES 代表设备被占用, 当前APP不能正常出图
@property (nonatomic, assign) BOOL deviceConflicted;

#pragma mark - 支持信息
/// 是否支持调节灯光
@property (nonatomic, assign) BOOL supportAdjustLight;

/** 当前硬件件是否支持灯光PWM调节 */
@property (nonatomic, assign, readonly, getter=isSupportPwm) BOOL supportPwm;
/** 当前硬件件是否支持硬件放大缩小 */
@property (nonatomic, assign, readonly, getter=isSupportHwZoomEvent) BOOL supportHwZoomEvent;
/** 当前硬件是否支持陀螺仪 */
//@property (nonatomic, assign, readonly, getter=isSupportGyroEvent) BOOL supportGyroEvent DEPRECATED_MSG_ATTRIBUTE("use CameraManager isSupportGyroscope");

/// 预加载缓存数据
- (void)preloadingCache;

/// 掉线清理缓存
- (void)cleanCache;

//#pragma mark  属性获取与操作
///**
// 设置亮度
// @param brightness brightness 1-100
// */
//- (void)setBrightness:(int)brightness;
//
///**
// 获取亮度
// */
//- (void)getBrightnessWithCompletion:(ProcessFloatBlock)completion;
//
///**
// 设置分辨率
// @param resolution resolution description
// */
//- (void)setResolution:(struct usb_camera_resolution *)resolution completion:(void(^)(BOOL ret))completion;
//
///**
// 获取当前分辨率
// @param completion completion description
// */
//- (void)getResolutionWithCompletion:(void(^)(struct usb_camera_resolution *resolution))completion;
//
///**
// 获取支持的分辨率列表
// @param completion completion description
// */
//- (void)getSupportResolutionsWithCompletion:(void(^)(struct usb_camera_resolution_array *resolution_array))completion;

@end

